package service.Impl;

import dao.Impl.UserDaoImpl;
import model.VO.UserLoginVO;
import model.entity.User;
import service.UserService;
import util.Encrypt;

public class UserServiceImpl implements UserService {
    UserDaoImpl ud=new UserDaoImpl();

    //用户登录
    @Override
    public UserLoginVO login(String username, String password) {
        return ud.login(username, Encrypt.toMd5(password));
    }

    @Override
    public int find(String username) {
        return ud.find(username);
    }

    @Override
    public void register(User u) {
        u.setPassword(Encrypt.toMd5(u.getPassword()));
        ud.register(u);
    }
}
